<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-Control"  content="no-transform">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>反馈建议</title>
    <link href="/statics/weui/weui.min.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        body {
            background-color: #FBF9FE;
        }
        .weui_cells_tips {
            margin-top: .3em;
            color: #888;
            padding-left: 15px;
            padding-right: 15px;
            font-size: 14px;
        }
        .weui_btn_area {
            margin: 1.17647059em 15px 0.3em;
        }
    </style>
</head>
<body>
<div class="weui_cells">
    <div class="weui_cell weui_cell_select weui_select_after">
        <div class="weui_cell_hd">
            类型
        </div>
        <div class="weui_cell_bd weui_cell_primary">
            <select class="weui_select" name="cat">
                <option value="1">功能建议</option>
                <option value="2">客户端</option>
                <option value="3">热点问题</option>
                <option value="4">其他</option>
            </select>
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary">
            <textarea class="weui_textarea" name="content" placeholder="欢迎提出您在使用过程中遇到的问题或宝贵建议（300字以内），感谢您对我们的支持。" rows="6"></textarea>
        </div>
    </div>
</div>
<div class="weui_btn_area">
    <a class="weui_btn weui_btn_primary btn-feedback"  href="javascript:" id="showTooltips">提交</a>
</div>
<div class="weui_cells_tips">底部说明文字底部说明文字</div>
<script src="//cdn.bootcss.com/jquery/2.1.0/jquery.min.js"></script>
<script type="text/javascript" src="/statics/layer.m/layer.m.js"></script>
<script type="text/javascript">

    $(function(){
        $(".btn-feedback").click(function(){
            var cat=$("select[name='cat']").val();
            var content=$("textarea[name='content']").val();
            layer.open({
                type: 2,
                content: '正在提交~'
            });
            $.ajax({
                url: "/feedback/save",
                type: "POST",
                data: {
                    cat: cat,
                    content:content
                },
                dataType: "json",
                cache: false,
                success: function(message) {
                    layer.closeAll();
                    if (message.type == "success") {
                        layer.open({
                            title:'提交成功',
                            content: message.content,
                            btn: ['确定'],
                            yes: function(){
                                location.href = "/dbs/index.html";
                            }
                        });
                    } else {
                        layer.open({
                            content: message.content,
                            time: 2
                        });
                    }
                },error:function(){
                    layer.closeAll();
                    layer.open({
                        content: "服务器异常",
                        time: 2
                    });
                }
            });
        });
    });
</script>
</body>
</html>